package com.hotacorp.opencloud.userservice.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.hotacorp.opencloud.common.commdata.Result;
import com.hotacorp.opencloud.userservice.redisinfo.RedisInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * Redis监控
 * @author lwg
 *
 */
@RestController
@Api(tags = "Redis监控API")
public class RedisMonitor {
	@Autowired
	private RedisInfo redisInfo;
	
    @RequestMapping(value = "/monitor/redis", method = {RequestMethod.OPTIONS, RequestMethod.GET, RequestMethod.POST})
    @PreAuthorize("hasAuthority('userservice:redismonitor:info')")
	@ApiOperation(value = "Redis详情")
    public Result<?> info(){
        return Result.succeed("succeed", redisInfo.info());
    }

}
